﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title></title>
    <link href="3rd-party/jquery-ui-1.8.2.custom.css" rel="stylesheet" type="text/css" />
    <style type="text/css">
        #left-side-bar {
            width: 160px;
        }
        #site-buttons {
            width: 100%;
            margin: 3px;
        }
        #site-buttons label {
            width: 100%;
            font-size: 10px;
        }
    </style>

    <script src="3rd-party/jquery-1.4.1.js" type="text/javascript"></script>

    <script src="3rd-party/jquery.cookie.js" type="text/javascript"></script>

    <script src="3rd-party/jquery-ui-1.8.2.custom.min.js" type="text/javascript"></script>

    <script src="scripts/Soapi.js" type="text/javascript"></script>

    <script type="text/javascript">
        $(function()
        {
            var sites = {};



            Soapi.Events.onError = function(errorsResponse, context)
            {
                errorsResponse = new Soapi.Responses.ErrorsResponse(errorsResponse);
                alert(context + "\r\n" + errorsResponse.message + "\r\n" + errorsResponse.url);
            }
            Soapi.Events.onSuccess = function(data, context)
            {
            }

            Soapi.Events.onComplete = function(data, errorsResponse, context)
            {
            }

            var apiKey = 's8x69SZnxkW1kBXeyT5fgA';


            //            Soapi.Utilities.IdentifyValidSites(apiKey, function(data)
            //            {

            //                //sites = data;

            Soapi.RouteFactory("", apiKey).Sites().getResponse(function(data, outerContext)
            {
                sites = data.items;
                $.each(data.items, function(idx, item)
                {
                    item.id = String(item.name).toLowerCase().replace(/\s+/g, "");
                    item.api_endpoint = item.api_endpoint.substring(7);
                    sites[item.api_endpoint] = item;

                    $("<input type='checkbox'/>").attr("id", "check." + item.api_endpoint).appendTo("#site-buttons");
                    $("<label/>").attr("for", "check." + item.api_endpoint).text(item.name).appendTo("#site-buttons");
                    $("<br/>").appendTo("#site-buttons");

         
                });

                $("#site-buttons").buttonset();
            }, null, null, "CONTEXT:initialize sites");


            //            });




        });
    </script>

</head>
<body>
<h1>work in progress - disregard</h1>
    <div id="left-side-bar">
        <div id="site-buttons">
        </div>
    </div>
</body>
</html>
